package com.taxshare.seller.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.taxshare.seller.entity.InvoiceConfigEntity;
import com.taxshare.seller.mapper.InvoiceConfigMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName: InvoiceConfigService
 * @Description:
 * @author: Hai
 * @date: 2021/6/3 11:01
 */
@Service
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
public class InvoiceConfigService extends ServiceImpl<InvoiceConfigMapper, InvoiceConfigEntity> {

    /**
     * 根据纳税人识别号 获取开票信息
     * @param
     * @return
     */
    public InvoiceConfigEntity selectInvoiceConfigByUserName(String userName) {
        QueryWrapper<InvoiceConfigEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_name", userName);
        InvoiceConfigEntity entity = baseMapper.selectOne(queryWrapper);
        return entity;
    }

}
